<?php
/**
 * Project: Recipe
 * File: RoleModel.class.php
 * Author: Xnfy520@gmail.com
 * Date: 12-5-2
 * Time: 下午12:09
 */

	class RoleModel extends RelationModel{

	protected $_link = array(

		'RoleUser'=>array(
			'mapping_type'=>HAS_MANY,
			'class_name'=>'RoleUser',
			'mapping_name'=>'roleuser',
			'foreign_key'=>'roleid',
		)

	);

	protected $_validate = array(
		array('name', 'require', '分组名称不能为空', 1, 'regex', 3),
		array('name', 'name', '分组名称已经存在', 1, 'unique', 3),
		array('sort', 'number', '排序必须为数字', 1, 'regex', 3),
		array('needexp', 'number', '所需经验必须为数字', 1, 'regex', 3),
	);


}